<?php /*a:2:{s:64:"/Applications/MAMP/htdocs/application/admin/view/book/index.html";i:1591322696;s:58:"/Applications/MAMP/htdocs/application/admin/view/base.html";i:1591321267;}*/ ?>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>MHK网络在线教育平台</title>
    <link rel="icon" href="/../static/admin/favicon.ico" type="image/ico">
    <link href="/../static/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="/../static/admin/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="/../static/admin/css/style.min.css" rel="stylesheet">
    <link href="/../static/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="/../static/admin/js/jquery.min.js"></script>
    <script type="text/javascript" src="/../static/admin/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/../static/admin/js/perfect-scrollbar.min.js"></script>
    <script type="text/javascript" src="/../static/admin/js/main.min.js"></script>
    <script type="text/javascript" src="/../static/layui/layui.all.js"></script>
    <!--图表插件-->
    <script type="text/javascript" src="/../static/admin/js/Chart.js"></script>

    <style>
        #logo{
            font-size: 30px;
        }
    </style>
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <div class="lyear-layout-sidebar-scroll">
                <!-- logo -->
                <div id="logo" class="sidebar-header ">
                   <a href="index.html" class=""></i>MHK网络在线教育平台</a>
                </div>

                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item active"> <a href="<?php echo url('admin/index/index'); ?>"><i class="mdi mdi-home"></i> 后台首页</a> </li>

                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-layers"></i> 课程管理</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/project/index'); ?>">课程列表</a> </li>
                                <li> <a href="<?php echo url('admin/project/add'); ?>">课程添加</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-video"></i> 视频管理</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/video/index'); ?>">视频列表</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-message-video"></i> 直播管理</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/live/index'); ?>">直播列表</a> </li>
                                <li> <a href="<?php echo url('admin/live/add'); ?>">开始直播</a> </li>
                                <li> <a href="<?php echo url('admin/live/reserve'); ?>">直播预约记录</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-library-books"></i> 动态咨询</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/article/index'); ?>">咨询列表</a> </li>
                                <li> <a href="<?php echo url('admin/article/add'); ?>">添加咨询</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-library-books"></i> 图书商城</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/book/index'); ?>">图书列表</a> </li>
                                <li> <a href="<?php echo url('admin/book/add'); ?>">图书添加</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-library-books"></i> 短视频管理</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/othvideo/index'); ?>">视频列表</a> </li>
                                <li> <a href="<?php echo url('admin/othvideo/add'); ?>">视频添加</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-library-books"></i> 购买记录</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/article/index'); ?>">购买列表</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 用户管理</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="<?php echo url('admin/user/index'); ?>">用户列表</a> </li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-set-all"></i> 网站配置</a>
                            <ul class="nav nav-subnav">
                                <li> <a href="/../static/admin/lyear_ui_buttons.html">配置项目</a> </li>
                            </ul>
                        </li>

                    </ul>
                </nav>

                <div class="sidebar-footer">
                    <p class="copyright">Copyright &copy; 2019. MHK在线学习平台 All rights reserved.</p>
                </div>
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <button class="pull-left hidden-lg hidden-md navbar-toggle" type="button" data-toggle="layout" data-action="sidebar_toggle">
                            <span class="sr-only">显示/隐藏侧边栏</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>

                    <ul class="topbar-right">
                        <li class="dropdown dropdown-profile">
                            <a href="javascript:void(0)" data-toggle="dropdown">
                                <span><?php echo session('name'); ?> <span class="caret"></span></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li> <a href="<?php echo url('admin/login/changepwd'); ?>"><i class="mdi mdi-lock-outline"></i> 修改密码</a> </li>
                                <li> <a href="<?php echo url('admin/login/layout'); ?>"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
                            </ul>
                        </li>
                    </ul>

                </div>
            </nav>

        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->

<!--页面主要内容-->
<main class="lyear-layout-content">

    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-header">
                        <h4>课程列表</h4>
                    </div>
                    <div class="card-body">

                        <div class="table-responsive">
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>图书名称</th>
                                    <th>图书摘要</th>
                                    <th>缩略图</th>
                                    <th>图书价格</th>
                                    <th>创建时间</th>
                                    <th width="150">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach($bookList as $v): ?>
                                <tr>
                                    <td><?php echo htmlentities($v['book_id']); ?></td>
                                    <td><?php echo htmlentities($v['book_name']); ?></td>
                                    <td><?php echo htmlentities($v['book_degist']); ?></td>
                                    <td><img src="<?php echo htmlentities($v['book_thumb']); ?>" style="width:40px;" onclick="openthumb('<?php echo htmlentities($v['book_thumb']); ?>')" alt="点击查看大图"></td>
                                    <td><?php echo htmlentities($v['book_price']); ?></td>
                                    <td><?php echo date('Y-m-d',$v['book_creat_time']); ?></td>
                                    <td>
                                        <div class="btn-group">
                                            <a class="btn btn-xs btn-default" onclick="del(<?php echo htmlentities($v['book_id']); ?>)" ><i class="mdi mdi-window-close"></i>删除</a>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; ?>

                                </tbody>
                            </table>
                        </div>


                    </div>
                </div>
            </div>

        </div>

    </div>

</main>
<!--End 页面主要内容-->
<script>
    layui.use('layer', function(){
        var layer = layui.layer;

    };
</script>
<script>
    function openthumb(url){
        layer.open({
            title:"查看大图",
            type: 2,
            content: url,
            area: ['600px', '400px']
        });
    }
    function del(pro_id) {
        layer.confirm('您确定删除图书吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.post('/admin/book/delete',{"id":pro_id},function (res) {
                if(res.msg){
                    layer.msg('删除成功', {icon: 1});
                    window.location.reload()
                }else {
                    layer.msg('删除失败',{icon:2});
                }
            })
            //layer.msg('的确很重要', {icon: 1});
        });
    }


</script>

        <!--End 页面主要内容-->
    </div>
</div>


<script type="text/javascript">
    $(document).ready(function(e) {
        var $dashChartBarsCnt  = jQuery( '.js-chartjs-bars' )[0].getContext( '2d' ),
            $dashChartLinesCnt = jQuery( '.js-chartjs-lines' )[0].getContext( '2d' );

        var $dashChartBarsData = {
            labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
            datasets: [
                {
                    label: '注册用户',
                    borderWidth: 1,
                    borderColor: 'rgba(0,0,0,0)',
                    backgroundColor: 'rgba(51,202,185,0.5)',
                    hoverBackgroundColor: "rgba(51,202,185,0.7)",
                    hoverBorderColor: "rgba(0,0,0,0)",
                    data: [2500, 1500, 1200, 3200, 4800, 3500, 1500]
                }
            ]
        };
        var $dashChartLinesData = {
            labels: ['2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014'],
            datasets: [
                {
                    label: '交易资金',
                    data: [20, 25, 40, 30, 45, 40, 55, 40, 48, 40, 42, 50],
                    borderColor: '#358ed7',
                    backgroundColor: 'rgba(53, 142, 215, 0.175)',
                    borderWidth: 1,
                    fill: false,
                    lineTension: 0.5
                }
            ]
        };

        new Chart($dashChartBarsCnt, {
            type: 'bar',
            data: $dashChartBarsData
        });

        var myLineChart = new Chart($dashChartLinesCnt, {
            type: 'line',
            data: $dashChartLinesData,
        });
    });
</script>
</body>
</html>